package com.bert.entity;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Properties;

@Data
@Component
@ConfigurationProperties(prefix = "spring.cloud.nacos.discovery")
public class NacosDiscoveryInfo {

    /**
     * Nacos server address.
     */
    private String serverAddr;

    /**
     * Nacos namespace.
     */
    private String namespace;

    /**
     * Nacos group.
     */
    private String group;

    /**
     * username
     */
    private String username;

    /**
     * password
     */
    private String password;

    public Properties getProperties(){
        Properties properties = new Properties();
        properties.put("serverAddr", this.getServerAddr());
        properties.put("namespace", this.getNamespace());
        properties.put("group", this.getGroup());
        properties.put("username", this.getUsername());
        properties.put("password", this.getPassword());
        return properties;
    }

}
